#pragma once

#include <DShow.h>


namespace DSP
{
	class simpleGraph
	{
	private:
		ATL::CComPtr<IGraphBuilder> pGraph;
	public:
		simpleGraph(){}
		simpleGraph(LPCWSTR fileName);
		~simpleGraph(void);
		template <typename T>
		void getInterface(T& p);
	};

	template <typename T>
	void simpleGraph::getInterface(T& p)
	{
		HRESULT hr = pGraph->QueryInterface(&p);
		if(FAILED(hr))
			throw errorInfo("Error: Can not get interface.", hr);
	}
}